﻿@using PagedList
@using PagedList.Mvc
@model IEnumerable<NapCardOnline.Models.Recharge>
@{
    ViewBag.Title = "Index";
}
<h2>
    Lịch sử gửi tiền</h2>
<div class="tabbable">
    <!-- Only required for left/right tabs -->
    <ul class="nav nav-tabs">
        <li>@Html.ActionLink("Thanh toán", "Index", "Payment")</li>
        <li class="active">@Html.ActionLink("Gửi tiền", "Index", "Recharge")</li>
        <li>@Html.ActionLink("Chuyển tiền", "Index", "TransferFund")</li>
    </ul>
    <div class="tab-pane active" id="tab1">
        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>
                        Mã GD
                    </th>
                    <th>
                        Phương thức gửi tiền
                    </th>
                    <th>
                        Tài khoản gửi
                    </th>
                    <th>
                        Tài khoản nhận
                    </th>
                    <th>
                        Ngày giờ giao dịch
                    </th>
                    <th>
                        Số tiền
                    </th>
                    <th>
                        Trạng thái
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            @Html.DisplayFor(modelItem => item.RechargeNo)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.RechargeType.RechargeTypeName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.User.UserName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.User1.UserName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.RechargeDate)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.RechargeAmount)
                        </td>
                             <td>
                                 @switch (item.FK_StatusID)
                                 {
                                     case 1:
                                         <span class="label label-success">
                                             @Html.DisplayFor(modelItem => item.Status.StatusName)
                                         </span>
                                         break;
                                     case 2:
                                         <span class="label label-important">
                                             @Html.DisplayFor(modelItem => item.Status.StatusName)
                                         </span>
                                         break;
                                     case 3:
                                         <span class="label label-warning">
                                             @Html.DisplayFor(modelItem => item.Status.StatusName)
                                         </span>
                                         break;
                                 }
                             </td>
                    </tr>
                }
            </tbody>
            <tfoot>
                <tr>
                    <th colspan="4" style="text-align: center">
                        Có tất cả @ViewBag.CountRecharge giao dịch
                    </th>
                    <th style="text-align: center;">
                        Tổng cộng
                    </th>
                    <th>
                        @ViewBag.TotalAmount
                    </th>
                    <th>
                    </th>
                </tr>
            </tfoot>
        </table>
    </div>
</div>
@Html.PagedListPager((IPagedList)ViewBag.OnePageOfRecharge, page => Url.Action("Index", new { page }))
